package com.gyyx.transfer;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.gyyx.transfer.service.JobExecuter;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * <p>
 * Title:Luncher
 * </p>
 * <p>
 * Description:程序启动主类
 * </p>
 * 
 * @author Li Enbo
 * @date 2017年11月10日上午9:33:44
 */
public class Luncher {
	private static final Logger LOGGER = LoggerFactory.getLogger(Luncher.class);
	private static final String AIPAY_SERVICE_PROVIDER_XML = "classpath:/applicationContext.xml";

	/**
	 * 程序启动主线程
	 * 
	 * @param args
	 */
 	@SuppressWarnings("unused")
	public static void main(String[] args) throws RuntimeException {
		LOGGER.info("【Oracle数据导出至MySql任务执行开始】");
		LOGGER.info("【开始载入配置文件】 : {}", AIPAY_SERVICE_PROVIDER_XML);
		@SuppressWarnings("resource")
		ApplicationContext ac = new ClassPathXmlApplicationContext(AIPAY_SERVICE_PROVIDER_XML);
		if (ac == null) {
			LOGGER.info("【获取上下文失败，程序终止】");
		}
		JobExecuter JobExecuter= (JobExecuter)ac.getBean("JobExecuter");
		int executer = JobExecuter.executer();
		LOGGER.info("【任务启动完毕启动完毕，请查看日志】");
	}
}
